<?php
namespace Home\Controller;
use Think\Controller;
class ShowsController extends Controller {
    public function index(){
	  $shows = D('shows');
	  $list = $shows->select();
	  $this->assign(array(
            'list'        => $list
            ));
	  $this->display();
    }

    function del(){
		$shows = D('shows');
		$id = I('get.id');
		$de = $shows->where("shows_id='$id'")->delete();
		// $json = array('success' =>$de);
  		// echo json_encode($json);
  		if($de==1){
            $this -> success('删完啦');
        }else{
            $this -> error('出错了');
        }
    }

    function xq(){
    	$shows = D('shows');
		$id = I('get.id');
		$info = $shows -> getByshows_id($id);
		$users_id = $info['users_id'];
		$club_id = $info['club_id'];
		$users = D('users');
		$inf = $users->getByusers_id($users_id);
		$club = D('club');
		$in = $club->getByclub_id($club_id);
		$this->assign(array(
            'club_name'         => $in['club_name'],
            'user_name'         => $inf['name'],
            'phone'             => $inf['phone'],
            'mail'              => $inf['mail'],
            'img'               => $info['img'],
            'pic'               => $inf['pic'],
            'shows_id'          => $id
            ));
	  	$this->display();
    }
}